using SheLife.Domain.Entities;

namespace SheLife.Application.Interfaces
{
    /// <summary>
    /// 服装服务接口
    /// </summary>
    public interface IClothingService
    {
        /// <summary>
        /// 根据ID获取服装
        /// </summary>
        /// <param name="id">服装ID</param>
        /// <returns>服装实体</returns>
        Task<Clothing?> GetClothingByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取服装列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>服装列表</returns>
        Task<IEnumerable<Clothing>> GetClothingsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和分类获取服装列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="category">分类</param>
        /// <returns>服装列表</returns>
        Task<IEnumerable<Clothing>> GetClothingsByUserIdAndCategoryAsync(Guid userId, string category);

        /// <summary>
        /// 根据用户ID和颜色获取服装列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="color">颜色</param>
        /// <returns>服装列表</returns>
        Task<IEnumerable<Clothing>> GetClothingsByUserIdAndColorAsync(Guid userId, string color);

        /// <summary>
        /// 根据用户ID和季节获取服装列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="season">季节</param>
        /// <returns>服装列表</returns>
        Task<IEnumerable<Clothing>> GetClothingsByUserIdAndSeasonAsync(Guid userId, string season);

        /// <summary>
        /// 创建服装
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="name">名称</param>
        /// <param name="category">分类</param>
        /// <param name="color">颜色</param>
        /// <param name="season">季节</param>
        /// <param name="imageUrl">图片URL</param>
        /// <param name="notes">备注</param>
        /// <returns>服装实体</returns>
        Task<Clothing> CreateClothingAsync(Guid userId, string name, string category, string color, string season, string? imageUrl = null, string? notes = null);

        /// <summary>
        /// 更新服装
        /// </summary>
        /// <param name="id">服装ID</param>
        /// <param name="name">名称</param>
        /// <param name="category">分类</param>
        /// <param name="color">颜色</param>
        /// <param name="season">季节</param>
        /// <param name="imageUrl">图片URL</param>
        /// <param name="notes">备注</param>
        /// <returns>服装实体</returns>
        Task<Clothing?> UpdateClothingAsync(Guid id, string? name, string? category, string? color, string? season, string? imageUrl = null, string? notes = null);

        /// <summary>
        /// 删除服装
        /// </summary>
        /// <param name="id">服装ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteClothingAsync(Guid id);
    }

    /// <summary>
    /// 搭配服务接口
    /// </summary>
    public interface IOutfitService
    {
        /// <summary>
        /// 根据ID获取搭配
        /// </summary>
        /// <param name="id">搭配ID</param>
        /// <returns>搭配实体</returns>
        Task<Outfit?> GetOutfitByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取搭配列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>搭配列表</returns>
        Task<IEnumerable<Outfit>> GetOutfitsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和场景获取搭配列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="occasion">场景</param>
        /// <returns>搭配列表</returns>
        Task<IEnumerable<Outfit>> GetOutfitsByUserIdAndOccasionAsync(Guid userId, string occasion);

        /// <summary>
        /// 根据用户ID和季节获取搭配列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="season">季节</param>
        /// <returns>搭配列表</returns>
        Task<IEnumerable<Outfit>> GetOutfitsByUserIdAndSeasonAsync(Guid userId, string season);

        /// <summary>
        /// 创建搭配
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="name">名称</param>
        /// <param name="description">描述</param>
        /// <param name="occasion">场景</param>
        /// <param name="season">季节</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>搭配实体</returns>
        Task<Outfit> CreateOutfitAsync(Guid userId, string name, string description, string occasion, string season, string? imageUrl = null);

        /// <summary>
        /// 更新搭配
        /// </summary>
        /// <param name="id">搭配ID</param>
        /// <param name="name">名称</param>
        /// <param name="description">描述</param>
        /// <param name="occasion">场景</param>
        /// <param name="season">季节</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>搭配实体</returns>
        Task<Outfit?> UpdateOutfitAsync(Guid id, string? name, string? description, string? occasion, string? season, string? imageUrl = null);

        /// <summary>
        /// 删除搭配
        /// </summary>
        /// <param name="id">搭配ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteOutfitAsync(Guid id);
    }

    /// <summary>
    /// 搭配服装服务接口
    /// </summary>
    public interface IOutfitClothingService
    {
        /// <summary>
        /// 根据ID获取搭配服装
        /// </summary>
        /// <param name="id">搭配服装ID</param>
        /// <returns>搭配服装实体</returns>
        Task<OutfitClothing?> GetOutfitClothingByIdAsync(Guid id);

        /// <summary>
        /// 根据搭配ID获取搭配服装列表
        /// </summary>
        /// <param name="outfitId">搭配ID</param>
        /// <returns>搭配服装列表</returns>
        Task<IEnumerable<OutfitClothing>> GetOutfitClothingsByOutfitIdAsync(Guid outfitId);

        /// <summary>
        /// 根据服装ID获取搭配服装列表
        /// </summary>
        /// <param name="clothingId">服装ID</param>
        /// <returns>搭配服装列表</returns>
        Task<IEnumerable<OutfitClothing>> GetOutfitClothingsByClothingIdAsync(Guid clothingId);

        /// <summary>
        /// 创建搭配服装
        /// </summary>
        /// <param name="outfitId">搭配ID</param>
        /// <param name="clothingId">服装ID</param>
        /// <returns>搭配服装实体</returns>
        Task<OutfitClothing> CreateOutfitClothingAsync(Guid outfitId, Guid clothingId);

        /// <summary>
        /// 删除搭配服装
        /// </summary>
        /// <param name="id">搭配服装ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteOutfitClothingAsync(Guid id);
    }

    /// <summary>
    /// 搭配记录服务接口
    /// </summary>
    public interface IOutfitRecordService
    {
        /// <summary>
        /// 根据ID获取搭配记录
        /// </summary>
        /// <param name="id">搭配记录ID</param>
        /// <returns>搭配记录实体</returns>
        Task<OutfitRecord?> GetOutfitRecordByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取搭配记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>搭配记录列表</returns>
        Task<IEnumerable<OutfitRecord>> GetOutfitRecordsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和日期范围获取搭配记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>搭配记录列表</returns>
        Task<IEnumerable<OutfitRecord>> GetOutfitRecordsByUserIdAndDateRangeAsync(Guid userId, DateTime startDate, DateTime endDate);

        /// <summary>
        /// 根据用户ID和场景获取搭配记录列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="occasion">场景</param>
        /// <returns>搭配记录列表</returns>
        Task<IEnumerable<OutfitRecord>> GetOutfitRecordsByUserIdAndOccasionAsync(Guid userId, string occasion);

        /// <summary>
        /// 创建搭配记录
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="outfitId">搭配ID</param>
        /// <param name="date">日期</param>
        /// <param name="notes">备注</param>
        /// <returns>搭配记录实体</returns>
        Task<OutfitRecord> CreateOutfitRecordAsync(Guid userId, Guid outfitId, DateTime date, string? notes = null);

        /// <summary>
        /// 更新搭配记录
        /// </summary>
        /// <param name="id">搭配记录ID</param>
        /// <param name="date">日期</param>
        /// <param name="notes">备注</param>
        /// <returns>搭配记录实体</returns>
        Task<OutfitRecord?> UpdateOutfitRecordAsync(Guid id, DateTime? date, string? notes);

        /// <summary>
        /// 删除搭配记录
        /// </summary>
        /// <param name="id">搭配记录ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteOutfitRecordAsync(Guid id);

        /// <summary>
        /// 获取搭配统计数据
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="days">统计天数</param>
        /// <returns>统计数据字典</returns>
        Task<Dictionary<string, object>> GetOutfitStatisticsAsync(Guid userId, int days = 30);
    }

    /// <summary>
    /// 搭配模板服务接口
    /// </summary>
    public interface IOutfitTemplateService
    {
        /// <summary>
        /// 根据ID获取搭配模板
        /// </summary>
        /// <param name="id">搭配模板ID</param>
        /// <returns>搭配模板实体</returns>
        Task<OutfitTemplate?> GetOutfitTemplateByIdAsync(Guid id);

        /// <summary>
        /// 获取所有搭配模板
        /// </summary>
        /// <returns>搭配模板列表</returns>
        Task<IEnumerable<OutfitTemplate>> GetAllOutfitTemplatesAsync();

        /// <summary>
        /// 根据分类获取搭配模板列表
        /// </summary>
        /// <param name="category">分类</param>
        /// <returns>搭配模板列表</returns>
        Task<IEnumerable<OutfitTemplate>> GetOutfitTemplatesByCategoryAsync(string category);

        /// <summary>
        /// 根据场景获取搭配模板列表
        /// </summary>
        /// <param name="occasion">场景</param>
        /// <returns>搭配模板列表</returns>
        Task<IEnumerable<OutfitTemplate>> GetOutfitTemplatesByOccasionAsync(string occasion);

        /// <summary>
        /// 根据季节获取搭配模板列表
        /// </summary>
        /// <param name="season">季节</param>
        /// <returns>搭配模板列表</returns>
        Task<IEnumerable<OutfitTemplate>> GetOutfitTemplatesBySeasonAsync(string season);

        /// <summary>
        /// 搜索搭配模板
        /// </summary>
        /// <param name="keyword">关键词</param>
        /// <returns>搭配模板列表</returns>
        Task<IEnumerable<OutfitTemplate>> SearchOutfitTemplatesAsync(string keyword);

        /// <summary>
        /// 创建搭配模板
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="occasion">场景</param>
        /// <param name="season">季节</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>搭配模板实体</returns>
        Task<OutfitTemplate> CreateOutfitTemplateAsync(string name, string description, string category, string occasion, string season, string? imageUrl = null);

        /// <summary>
        /// 更新搭配模板
        /// </summary>
        /// <param name="id">搭配模板ID</param>
        /// <param name="name">名称</param>
        /// <param name="description">描述</param>
        /// <param name="category">分类</param>
        /// <param name="occasion">场景</param>
        /// <param name="season">季节</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>搭配模板实体</returns>
        Task<OutfitTemplate?> UpdateOutfitTemplateAsync(Guid id, string? name, string? description, string? category, string? occasion, string? season, string? imageUrl = null);

        /// <summary>
        /// 删除搭配模板
        /// </summary>
        /// <param name="id">搭配模板ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteOutfitTemplateAsync(Guid id);
    }

    /// <summary>
    /// 搭配模板项服务接口
    /// </summary>
    public interface IOutfitTemplateItemService
    {
        /// <summary>
        /// 根据ID获取搭配模板项
        /// </summary>
        /// <param name="id">搭配模板项ID</param>
        /// <returns>搭配模板项实体</returns>
        Task<OutfitTemplateItem?> GetOutfitTemplateItemByIdAsync(Guid id);

        /// <summary>
        /// 根据模板ID获取搭配模板项列表
        /// </summary>
        /// <param name="templateId">模板ID</param>
        /// <returns>搭配模板项列表</returns>
        Task<IEnumerable<OutfitTemplateItem>> GetOutfitTemplateItemsByTemplateIdAsync(Guid templateId);

        /// <summary>
        /// 创建搭配模板项
        /// </summary>
        /// <param name="templateId">模板ID</param>
        /// <param name="category">分类</param>
        /// <param name="description">描述</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>搭配模板项实体</returns>
        Task<OutfitTemplateItem> CreateOutfitTemplateItemAsync(Guid templateId, string category, string description, string? imageUrl = null);

        /// <summary>
        /// 更新搭配模板项
        /// </summary>
        /// <param name="id">搭配模板项ID</param>
        /// <param name="category">分类</param>
        /// <param name="description">描述</param>
        /// <param name="imageUrl">图片URL</param>
        /// <returns>搭配模板项实体</returns>
        Task<OutfitTemplateItem?> UpdateOutfitTemplateItemAsync(Guid id, string? category, string? description, string? imageUrl = null);

        /// <summary>
        /// 删除搭配模板项
        /// </summary>
        /// <param name="id">搭配模板项ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteOutfitTemplateItemAsync(Guid id);
    }

    /// <summary>
    /// 用户搭配模板服务接口
    /// </summary>
    public interface IUserOutfitTemplateService
    {
        /// <summary>
        /// 根据ID获取用户搭配模板
        /// </summary>
        /// <param name="id">用户搭配模板ID</param>
        /// <returns>用户搭配模板实体</returns>
        Task<UserOutfitTemplate?> GetUserOutfitTemplateByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取用户搭配模板列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>用户搭配模板列表</returns>
        Task<IEnumerable<UserOutfitTemplate>> GetUserOutfitTemplatesByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和模板ID获取用户搭配模板列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="templateId">模板ID</param>
        /// <returns>用户搭配模板列表</returns>
        Task<IEnumerable<UserOutfitTemplate>> GetUserOutfitTemplatesByUserIdAndTemplateIdAsync(Guid userId, Guid templateId);

        /// <summary>
        /// 创建用户搭配模板
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="templateId">模板ID</param>
        /// <param name="notes">备注</param>
        /// <returns>用户搭配模板实体</returns>
        Task<UserOutfitTemplate> CreateUserOutfitTemplateAsync(Guid userId, Guid templateId, string? notes = null);

        /// <summary>
        /// 更新用户搭配模板
        /// </summary>
        /// <param name="id">用户搭配模板ID</param>
        /// <param name="notes">备注</param>
        /// <returns>用户搭配模板实体</returns>
        Task<UserOutfitTemplate?> UpdateUserOutfitTemplateAsync(Guid id, string? notes);

        /// <summary>
        /// 删除用户搭配模板
        /// </summary>
        /// <param name="id">用户搭配模板ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteUserOutfitTemplateAsync(Guid id);
    }

    /// <summary>
    /// 搭配建议服务接口
    /// </summary>
    public interface IOutfitSuggestionService
    {
        /// <summary>
        /// 根据ID获取搭配建议
        /// </summary>
        /// <param name="id">搭配建议ID</param>
        /// <returns>搭配建议实体</returns>
        Task<OutfitSuggestion?> GetOutfitSuggestionByIdAsync(Guid id);

        /// <summary>
        /// 根据用户ID获取搭配建议列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>搭配建议列表</returns>
        Task<IEnumerable<OutfitSuggestion>> GetOutfitSuggestionsByUserIdAsync(Guid userId);

        /// <summary>
        /// 根据用户ID和日期获取搭配建议列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="date">日期</param>
        /// <returns>搭配建议列表</returns>
        Task<IEnumerable<OutfitSuggestion>> GetOutfitSuggestionsByUserIdAndDateAsync(Guid userId, DateTime date);

        /// <summary>
        /// 创建搭配建议
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="outfitId">搭配ID</param>
        /// <param name="date">日期</param>
        /// <param name="reason">原因</param>
        /// <returns>搭配建议实体</returns>
        Task<OutfitSuggestion> CreateOutfitSuggestionAsync(Guid userId, Guid outfitId, DateTime date, string reason);

        /// <summary>
        /// 更新搭配建议
        /// </summary>
        /// <param name="id">搭配建议ID</param>
        /// <param name="reason">原因</param>
        /// <param name="isAccepted">是否接受</param>
        /// <returns>搭配建议实体</returns>
        Task<OutfitSuggestion?> UpdateOutfitSuggestionAsync(Guid id, string? reason, bool? isAccepted);

        /// <summary>
        /// 删除搭配建议
        /// </summary>
        /// <param name="id">搭配建议ID</param>
        /// <returns>是否成功</returns>
        Task<bool> DeleteOutfitSuggestionAsync(Guid id);

        /// <summary>
        /// 生成搭配建议
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="date">日期</param>
        /// <param name="occasion">场景</param>
        /// <param name="weather">天气</param>
        /// <returns>搭配建议列表</returns>
        Task<IEnumerable<OutfitSuggestion>> GenerateOutfitSuggestionsAsync(Guid userId, DateTime date, string occasion, string weather);
    }
}